<?php
/**
 * HP作成契約検索用SQL作成クラス<br />
 *
 * @package apamanshop
 * @author SS鈴木
 * @copyright
 */
class Rstobi_Model_HpkeiyakuSearch extends Rstobi_Model_Base
{

    /**
     * HP作成契約検索用From句取得
     *
	 * @access	public
	 * @return  string
     */
	public function getFromForHpKeiyakusearch($params)
	{
		$sql = "";
		$sql .=" FROM";
		$sql .="     T03WEB_HEYA T03";
		$sql .="     ,T76KAMEITEN_HP_CONTENTS_HEYA ";

		return $sql;
	}

    /**
     * HP作成契約検索用Where句取得
     *
	 * @access	public
	 * @return  string
     */
	public function getWhereForHpKeiyakusearch($params ,&$db_params)
	{
		$db_params['keiyaku_cd'] = $params['keiyaku_cd'];
		$db_params['shubetsu']  = $params['shubetsu'];

		$sql = "";
		$sql .=" WHERE";
		$sql .="     T76_KEIYAKU_CD = : keiyaku_cd ";
		$sql .="     AND T03_TENPO_CD = T76_TENPO_CD";
		$sql .="     AND T76_ORIGINAL_HEYA_CD in ( T03_ORIGINAL_HEYA_CD01, T03_ORIGINAL_HEYA_CD02)";
		$sql .="     AND T76_KASHIDASHI_KUBUN = T03_KASHIDASHI_KUBUN";
		$sql .="     AND T76_CONTENTS_CD = : shubetsu ";

		return $sql;
	}

}
?>